<?php
if (!defined("_INDEX")) { header("Location: /"); die; }

require_once ADMIN.DS."/head.php";
?>
<h1>Список вопросов</h1><br />
<table cellpadding='0' cellspacing='0' class='list' style="width: 100%">
	<tr class='table_header'>
		<td width='50px'>ID</td>
		<td>Вопрос</td>
		<td width='80px' class='actions'>Действия</td>
	</tr><?php
		$questions = $db->getTable("select * from `tip_questions` order by `id` desc");
		foreach($questions as $q)
		{
			echo "<tr><td>$q[id]</td>";
			echo "<td>";
				echo "<p style='line-height: 26px'><span style='font-weight: bold;'>От:</span> {$q['name']} (<a href='mailto:{$q['e-mail']}'>{$q['e-mail']}</a>) <span style='font-weight: bold;'>IP:</span> {$q['ip']}<br />";
				echo "<span style='font-weight: bold;'>Время:</span> ".date("d.m.Y H:i",$q['time'])."<br />";
				echo "<span style='font-weight: bold;'>Вопрос:</span> ".$q['text'];
			echo "</p></td>";
			echo "<td width='200px' class='actions'><a href='/admin/questions/delete/$q[id]' class='delete'>Удалить</a></td></tr>";
		}
?></table>

<?php require_once ADMIN.DS."/footer.php"; ?>